FROM ubuntu

RUN apt-get update && \
    apt-get install -y \
    xinetd \
    telnetd \
    vsftpd \
    tftpd-hpa \
    telnetd \
    rsh-server \
    finger \
    && \
    apt-get clean

RUN mkdir -p \
    /var/ftp/upload \
    /var/lib/tftpboot \
    &&\
    chmod -R 777 \
    /var/ftp/upload \
    /var/lib/tftpboot

RUN useradd -m -s /bin/bash -p "" telnet && \
    echo 'localhost u' >>  /etc/hosts.equiv && \
    echo 'localhost u' >> /home/telnet/.rhosts

COPY net-server/ /

EXPOSE 7/tcp 7/udp 9/tcp 9/udp 13/tcp 13/udp 19/tcp 19/udp 21 23 37/tcp 37/udp 69/udp 79 513 514 990 2121

CMD ["bash", "-c", "syslogd && xinetd && tail -f /var/log/syslog"]
